bitcoin core – OpenSSL error when running “make” command

I am trying to install bitcoin core on my ubuntu server.
installed necessary dependencies.
RAN :
./autogen.sh
./configure –disable-wallet –with-incompatible-bdb –with-gui=no
./configure
make

I am getting OpenSSL errors when I run make.

bignum.h:593:77: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM*’ {aka ‘const bignum_st*’}
593 | inline bool operator>(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) > 0); }
| ^~
| |
| const CBigNum*
In file included from /usr/include/openssl/asn1.h:23,
from /usr/include/openssl/objects.h:15,
from /usr/include/openssl/evp.h:28,
from /usr/include/openssl/x509.h:18,
from /usr/include/openssl/ssl.h:20,
from /usr/include/boost/asio/ssl/detail/openssl_types.hpp:24,
from /usr/include/boost/asio/ssl/context_base.hpp:19,
from /usr/include/boost/asio/ssl/context.hpp:23,
from /usr/include/boost/asio/ssl.hpp:18,
from rpcprotocol.h:16,
from rpcserver.h:10,
from bitcoind.cpp:6:
/usr/include/openssl/bn.h:274:26: note: initializing argument 1 of ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
274 | int BN_cmp(const BIGNUM *a, const BIGNUM *b);
| ~~~~~~~~~~~~~~^
make(3): *** (Makefile:865: bitcoind.o) Error 1
make(3): Leaving directory ‘/root/bitcoin/src’
make(2): *** (Makefile:887: all-recursive) Error 1
make(2): Leaving directory ‘/root/bitcoin/src’
make(1): *** (Makefile:673: all) Error 2
make(1): Leaving directory ‘/root/bitcoin/src’
make: *** (Makefile:509: all-recursive) Error 1

I did run sudo apt-get install libssl-dev but it doesn’t help.