Do you have separate "dev" packages that you have not installed?
I would guess that the base package for a library "FFF" contains file
"libFFF.so.x.y" and symbolic link "libFFF.so.x" that points to "libFFF.so.x.y".
Then there might be a separate package *-dev, *-devel, etc
1. Header files for FFF that your code will include
2. "libFFF.so" that is a symbolic link to "libFFF.so.x.y".
(3. Optionally "libFFF.a" for static linking.)
The -lGL most likely makes the linker to look for libGL.so.
However, it will dereference link and/or read version from the library
so that the binary will require libGL.so.1 during runtime.
Ok, the I found the error with the help you the latest post: There was no libGL.so, only the symbolic link libGL.so.1 and the actual library libGL.so.1.2. So I created a new symbolic link libGL.so pointing to libGL.so.1.2 and solved it.