I solved with an apt-get install libpq-dev