tl;dr I needed to install the libpq5 library and libpq-dev packages.
I thought I followed the docs carefully and I double-checked, they didn't list those dependencies. I don't know where else I should be expected to look for an official list of dependencies.
The guys over at the Qt forum solved it for me and there is some useful information there.