[tools] ccache: fix compilation, link statically