Fix CMake files on centos 6

On Centos 6, the CMake files is broken. I have a fix and have tested on Centos 6.5.
Thanks! The problems met with were due to other complicated local environments.