Use C++ and C++ flags for .cpp source in libraries

.cpp files in libraries were being compiled with C and C flags which
caused compile errors when Watchdog.hh was included because it includes
Queue.h that depends on C++ for static_assert.