Added gprof support to the build scripts.
Merge pull request #364 from plesner/prof

Added gprof support to the build scripts.