-lX11
or -lXext
I get complaints from the linker like
ld: library not found for -lX11
or
ld: library not found for -lXext
To fix this you could modify your environment paths, or add the following to your compile flags:
-L/usr/X11/lib
I do that and everything compiles and links fine.