Download needed packages for building OpenSSL:
Then you have to alter the debian/rules file so as to disable the zlib during compilation.
Next you can start the build process:
The custom version is installed. You now have to prevent future updates from overwriting your custom versions:
Of course, this means that when new openssl versions are released they won't be automatically installed. You have to repeat this process each time, specially since they tend to be security updates.