In my experience, a lot of Linux programs aren't straightforward to compile statically. Having said that, that might just be my ineptitude!
Which bit of the caching isn't clear? If you're happy that whack creates relocatable versions, then the caching works just by copying the output directory into ~/.cache, and then copying that directory to the target on subsequent installations. The exact details of how programs are made relocatable are under "How does Whack work?" in the README.