Error: Missing the OpenSSL lib? while trying to install python

There is an official guide for troubleshooting build problems here https://github.com/pyenv/pyenv/wiki/common-build-problems

So for openSuse you must first install the dependencies with:

zypper in zlib-devel bzip2 libbz2-devel libffi-devel libopenssl-devel \
readline-devel sqlite3 sqlite3-devel xz xz-devel

And also for Ubuntu/Debian:

sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git

Python makes use of underlying operating system libraries to support some of its libraries, and it appears you don't have these libraries installed. On Ubuntu you should be able to install them with

$ sudo apt-get install bzip2 libreadline6 libreadline6-dev openssl

For SUSE 12, as you have pointed out, the command required was

zypper -n install openssl libopenssl-devel

In addition to the above answer I had to:

sudo apt-get install python-openssl