This is a truly popular question here at SO, but none of the many answers I have looked at, clearly explain what this error really mean, and why it occurs.
One sour
Try this:
sudo apt-get install libpcap-dev libpq-dev
It has worked for me when I have installed these two.
See the link here for more information