Add CMake check for libatomic.