Added -pthread flag to CXX_FLAGS for non clang builds