I just ran into this problem today while trying to build Python 3.10 on CentOS 7, and found this thread while trying to figure it out. In my case I'm just trying to get all of Python to build, including the SSL module which it attempts to build by default. What follows may or may not be adaptable to building pyOpenSSL by itself.
I found that the configure script appears to be designed to work with OpenSSL files that are installed in the normal locations in /usr/lib64 and /usr/include, or alternatively in one single location that you can specify on the command line with the --with-openssl parameter, under which you can find the include files and libraries directly. The 'openssl11-devel' package in RHEL/CentOS 7 satisfies neither of these expectations, and as far as I can tell this can't be dealt with on the configure command line.
I found the easiest way to work around it was to just change the library name the script is using with its pkg-config queries, so it can get the correct details from the .pc file which fortunately is in the standard location under /usr/lib64/pkgconfig but with a different name.
The approach I used happens to work with an install of Python3.10.0 on CentOS 7, though admittedly it's brittle and may not continue to work with other versions. From within the source directory:
sed -i 's/PKG_CONFIG openssl /PKG_CONFIG openssl11 /g' configure
Having done the above, I run ./configure. I see in the output:
checking whether compiling and linking against OpenSSL works... yes
...rather than the 'no' I was getting before.
Probably unrelated -- I am unable to get the compile to work with --enable-optimizations on CentOS 7, for whatever reason. I get the 'Could not import runpy module' error, so I configure without it.