RPMs are always split up into areas of concern. They're typically named:
<pkg>.<arch> <pkg>-devel.<arch> <pkg>-libs.<arch>
Where <pkg> would be openssl and <arch> will i686 or x86_64. There are other architectures but these are the common ones on AMD/Intel hardware so we'll stick to just those for this discussion.
The actual tools that comprise the openssl software are included in the RPM openssl.x86_64. Notice how the name of this RPM conforms to the patterns I showed above?
The libraries (.so) are in this RPM, openssl-libs.x86_64 while the header files (.h) are in this RPM, openssl-devel.x86_64.
So your issue is you haven't actually installed the library or header files so that your package can compile and link against the openssl package.
Try this:
$ yum search openssl | grep ^openssl openssl-devel.i686 : Files for development of applications which will use openssl-devel.x86_64 : Files for development of applications which will use openssl-perl.x86_64 : Perl scripts provided with OpenSSL openssl-pkcs11.x86_64 : A PKCS#11 engine for use with OpenSSL openssl-static.i686 : Libraries for static linking of applications which will openssl-static.x86_64 : Libraries for static linking of applications which will openssl.x86_64 : Utilities from the general purpose cryptography library with openssl-libs.x86_64 : A general purpose cryptography library with TLS openssl-libs.i686 : A general purpose cryptography library with TLS openssl098e.i686 : A compatibility version of a general cryptography and TLS openssl098e.x86_64 : A compatibility version of a general cryptography and TLS
Now to install them:
$ sudo yum install -y openssl-{devel,libs}
Once installed you can confirm the contents of the openssl-libs RPM:
$ rpm -ql openssl-libs | grep libssl.so /usr/lib64/.libssl.so.1.0.2k.hmac /usr/lib64/.libssl.so.10.hmac /usr/lib64/libssl.so.1.0.2k /usr/lib64/libssl.so.10
What if I don't know what RPM to install?
This is a common question that I see all the time. Most people that are either new to Redhat distros such as Fedora/CentOS/RHEL are unaware of the repoquery command line tool. With this tool you can query remote YUM repositories and look for what packages provide a given file.
So in your scenario:
$ repoquery -qf */libssl.so* openssl-libs-1:1.0.2k-12.el7.x86_64 openssl-devel-1:1.0.2k-12.el7.x86_64 openssl098e-0:0.9.8e-29.el7.centos.3.i686 openssl-libs-1:1.0.2k-12.el7.i686 openssl-devel-1:1.0.2k-12.el7.i686
We can see that the libssl.so* file is included with all the above RPMs. So based on your existing RPM, you'd likely want these 2:
openssl-libs-1:1.0.2k-12.el7.x86_64 openssl-devel-1:1.0.2k-12.el7.x86_64
NOTE: Keep in mind that I'm showing you CentOS 7.x packages, you're using Amazon's AMI which is their own branded package of CentOS, so the names are slightly different, but the process I've shown you should be identical, regardless.