You don't have development headers for X. In simple words it means you need to install some more packages. All required should be on your installation cd. This one is xorg-devel or xorg-dev (or a similar name, they are different in different distributions).
Note that after you resolve this one you'll likely get another such error, with different program/library name. The package to install will also be programname-devel.
Or, if you have much free space, just install all packages from the 'Development' or 'Programming' section of your distribution.