OpenSSL 3.x made the DH struct opaque. Replace direct dh->p/dh->g
member access with DH_set0_pqg() behind a version guard so older
OpenSSL (< 1.1.0) keeps the original code path.
OpenSSL 3.x removed <openssl/md2.h> but keeps MD2_Init as a
deprecated shim in libcrypto. Add AC_CHECK_HEADER([openssl/md2.h])
inside the existing AC_CHECK_LIB block so HAVE_CRYPTO_MD2 is only
defined when both the function and header are available.