Try: dpkg -L libssl-dev
You try to use a ROOT binary distribution for “Ubuntu 14.04 / GCC 4.8”,
It will not work on “Ubuntu 22.04 / GCC 11.3”.
If you cannot switch to the current ROOT 6 for “Ubuntu 22.04 / GCC 11.3”, you either need to create and use a “Ubuntu 14.04” container or a virtual machine, or you need to build ROOT 5 yourself → Number 5 is Alive!