Properly detect EL5, fixes and workarounds to make it compile and link.
Properly detect EL5, fixes and workarounds to make it compile and link.

wayfinder/Wayfinder-Server,wayfinder/Wayfinder-Server,wayfinder/Wayfinder-Server,wayfinder/Wayfinder-Server,wayfinder/Wayfinder-Server,wayfinder/Wayfinder-Server,wayfinder/Wayfinder-Server