Your cmake and gcc versions are too old.

Whatever the current versions for RedHat 7 are should work:
cmake 2.8.12.2 and above works
gcc 4.8.5 and above works

You can get the latest binaries for cmake from
https://cmake.org/download/

Be sure to put the path to the latest cmake in your PATH environment variable before the path to the old one.

Or, you can use the 'configure' argument
'--cmake <path to cmake>'

How to get up to date gcc binaries will depend on your system.