Added gprof support to the build scripts.