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

TODO: create a list of flags which should be set for a profiling build