change way to check for OpenGL libraries to work on both OS X and GNU
merge