CMake: add missing -pthread to CXXFLAGS
CMake: add warnings to CXXFLAGS

Since every C++ text book encourages the usage of compiler warnings
we should also enable them by default. This will help to increase
code quality by factors.