The prefix=/usr/local/ssl isprefix=/usr/local/ssl is not the default opensslOpenSSL isstalaltion prefix on ubuntuUbuntu 22. You now have a new version on /usr/local/ssl/usr/local/ssl and a default one. You may try to buidlbuild with the following options
export CONFARGS = --prefix=/usr --openssldir=/usr/lib/ssl --libdir=lib/x86_64-linux-gnu no-idea no-mdc2 no-rc5 no-zlib no-ssl3 enable-unit-test no-ssl3-method enable-rfc3779 enable-cms no-capieng ./Configure shared $(CONFARGS) linux-x86_64 && perl configdata.pm -d make -j4 make install May be createMaybe create a deb.deb package and test it before installing.