As the error message states, the compiler was not found in your $PATH (the path variable used by bash when looking for executables). If you were installing as user, it probably wouldn't be. But, if you were installing as root, it should be in your path.
To fix this, edit /etc/ld.so.conf and add the paths to the compilers mentioned in the error message. Then run the command 'source /etc/ld.so.conf' to get bash to reload the $PATH, then try again.
Just remember that you may have to su to root to finish the process. User has limited privileges, and can only take the process so far, then root privilege is required to finish.