To compile on at least Debian 7 through 9, install the following packages 
first:

build-essential libx11-dev libxrandr-dev libxrender-dev libwebp-dev
libxau-dev libc6-dev libxt-dev libjpeg-dev
libtiff-dev libpng-dev libjasper-dev

This should translate across most Debian-based distributions.
