The error message says to add libGL to the linker line. Did you do that?
How about this:https://wiki.archlinux.org/index.php/Fan_Speed_Control
It builds fine here. Look at that line in configure, what is there? Mine has the first half of what is in your error message, but not the second half - it looks like something got tacked on to the end of some lines in your configure script.
You don't want to merge them, you just want to replace one with a link to the other. `man ln`
The actual errors would help - and the compile command you are using.That code compiles and runs fine here.
Also check /etc/profile and /etc/rc.local
`pacman -S linux-headers`
Do you have a GTK2_RC_FILES environment variable?
https://wiki.archlinux.org/index.php/LXDM#SessionlistJust add a "suspend.desktop" to that folder with an exec line to run your preferred suspend command.