When you have ccache installed, it installs a program called gcc, but it is not in the same place as the regular gcc. You cn either set the PATH so that th ccache gcc is found before the normal gcc, or you can just hard-code the full path to the ccache version of the program in your Makefile.
Not sure what distro you are on but here's how to find out the path the ccache gcc on a debian based system (the ccache package is called simply 'ccache'):
$ dpkg --listfiles ccache |grep '/gcc$'
So you can simply set in your Makefile