Check if X11 headers are available on MacOS

Instead of unconditionally depending on GLX, we check if the X11 headers
are available, and if not, the GLX build is disabled.