Attempt to remove OpenGL libraries from link when using OSMesa.