Look for the lib64 directory when using a custom OpenSSL directory
For Tor Browser, we build tor in an old Debian container that has a very old OpenSSL.
So, we also compile OpenSSL and use a custom prefix with --with-openssl-dir=$openssldir.
From what I understood (by compiling with make V=1), it seems to me that tor's build system tries to use $openssldir/lib as a library directory (and IIRC, it falls back to $openssldir when it doesn't exist).
However, with OpenSSL 3, the default directory has become $openssldir/lib64 (at least on Linux amd64).
Linking $openssldir/lib to $openssldir/lib64 seems to solve all the various problems.