Fix gcc build

Note to linux users:
If it doesn't link with X11, do this:
cmake .. -DCMAKE_CXX_FLAGS:STRING=-lX11