If you don't want to build Squid from scratch, you can simply Setup a Squid anonymous proxy
Please note that this whole manual refers to the version 3.5.23 of Squid. You probably would have to adapt some commands to the version you will actually download.