Internal CPU profiling

Added internal profiling and adjusted the macro -D__PROFILING in the makefiles as default