This was done on a stock ubuntu 14.04 cloud install, but should work on any distro (although you'd need to tweak the package install part to use yum or whatever and appropriate package names)
- Install the packages needed for things to build
apt-get update && apt-get install -y curl build-essential libx11-dev libxext-dev libpcap-dev zlib1g-dev libgdbm-dev