Not sure if this is helpful, but on Debian I was getting the same error until I installed the "nvidia-glx-dev" package. Seems xlibmesa-gl-dev includes its own (non-accelerated) /usr/lib/libGL.a which CS linked against; nvidia-glx-dev redirects it away.