The OpenSSL library can be tricky to get going on Windows.
If you are brave, you can obtain the OpenSSL library source code directly from https://www.openssl.org/source/. You will, of course, need to build OpenSSL before it can be used. Building OpenSSL is not easy, but instructions are provided in the INSTALL and NOTES.WIN files included with the OpenSSL source code.
An easier alternative is to install prebuilt OpenSSL binaries. You can find a list of prebuilt OpenSSL binaries from the OpenSSL wiki at https://wiki.openssl.org/index.php/Binaries. You will need to locate binaries that match your operating system and compiler. Installing them will be a matter of copying the relevant files to the MinGW include, lib, and bin directories.
The following screenshot shows a binary OpenSSL distribution. The include and lib folders should be copied...