Updates of the main cmakelists.txt

- Fixed a typo.
- Refactored X11/GLX detection.