Hi,
I cannot reproduce this. You cannot run BSD make in the postgresql source tree, as you suggest, so I don't really understand what goes wrong. What is your platform? uname -a? a log from the failing build would also be great.
Can you show some more insights into what goes wrong?
What happens when you run
cd /usr/ports/databases/postgresql95-client
make clean all
Regards,
Palle

Created attachment 190819[details]
config.log
Hi,
sorry for the confusion. My host runs 11.1-RELEASE-p6 amd64
When I run portupgrade databases/postgresql95-client
the build fails:
checking for sgml2xml... no
checking for sx... no
checking thread safety of required library functions... no
configure: error: thread test program failed
This platform is not thread-safe. Check the file 'config.log' or compile
and run src/test/thread/thread_test for the exact reason.
Use --disable-thread-safety to disable thread safety.
===> Script "configure" failed unexpectedly.
config.log is attached.
I tried to build src/test/thread/thread_test, but it failed also. So I assume that the failed build of the test tool lets the whole build fail.

Hmm, I tried a first-time build on another 11.1-RELEASE-p6 amd64 machine and got:
# cd /usr/ports/databases/postgresql95-client
# make
===> postgresql95-client-9.5.11 depends on package: pkgconf>=1.3.0_1 - found
===> postgresql95-client-9.5.11 depends on executable: gmake - found
===> postgresql95-client-9.5.11 depends on executable: msgfmt - found
===> postgresql95-client-9.5.11 depends on file: /usr/local/lib/libcrypto.so.42 - found
===> postgresql95-client-9.5.11 depends on package: perl5>=5.24<5.25 - found
===> postgresql95-client-9.5.11 depends on shared library: libreadline.so.7 - found (/usr/local/lib/libreadline.so.7)
===> postgresql95-client-9.5.11 depends on shared library: libintl.so - found (/usr/local/lib/libintl.so)
===> Configuring for postgresql95-client-9.5.11
env: ./configure: No such file or directory
===> Script "configure" failed unexpectedly.
Please report the problem to pgsql@FreeBSD.org [maintainer] and attach the
"/usr/ports/databases/postgresql95-client/work/postgresql-9.5.11/config.log"
But there is no config.log
Could it be that ccache is confused? I use it on both hosts. When I disable ccache on this (2nd) host, I get the same error as in comment #2.

Seems a bit suspicions. I use ccacche as well. Your ports tree and build chain are of course up to date, just double checking.
It tends to fail on thread-safe issues. What's in your /etc/make.conf?
Palle

Sorry, no. Instead, I have installed a virtual FreeBSD meanwhile and compiled postgresql-client successfully, so it is no SSL issue.
That system is now building world and kernel, after that I will try to compile the client again.