Add a Makefile setting for buildign with ccache.

This greatly speeds up the build when frequently rebuilding from scratch
(e.g. in case of a buildbot). Some hacks are added for using ccache in
combination with Clang.
Merge pull request #8567 from maleadt/master

Add a Makefile setting for buildign with ccache.