Modify cmake to compile with atomic library and g++ 4.8.