psql: relocation error: psql: undefined symbol: PQgetssl
This is a "linker" error; the linker's job is to connect some executable to the libraries it uses. So, this error is related to binary files, i.e., something that has been compiled and linked. It is not related to scripts or configurations (except possibly pre-compile source-configuration scripts).
My guess is that you have been trying repeatedly to get things to work, and not everything got rebuilt as you tried again under newer conditions.
The usual thing to do in a case like this is to delete all the binary files and rebuild the whole thing[1], but there is another possibility lurking:
You might also have several versions of postgres lying around, maybe one that was installed with your OS and the one you're trying to compile, at minimum. It could be that the psql you are trying to run is not the one for the version of postgres you are building (i.e., it's the wrong one). You should find out if this is the case[2], locate the correct binaries and arrange to search first for binaries there.
[1]
make clean
make
[2]
which psql
(-or-)
whereis psql