I am trying to compile Varnish caching on my Mac OS X
The easiest solution is to use a package manager like brew.

Download and install it using the installer on their website.

And then simply brew install varnish. It will download and install all the prerequisites for you.