Add support for profiling build

Add an option to configure for compiling a profiling build and set C and
C++ compiler flags for this build