The switch
--with-ssl={gnutls,openssl}
needs the location of the the header files (*.h) usually in /usr/include/openssl it's a good idea to run configure with --includedir=/usr/include/ telling configure where to look for includes.
If /usr/include/openssl exists on your system and is having *.h files - it should be the right place. 
You need to install the
openssl-devel (cent / redhat with yum) or libssl-dev (debian, ubuntu with apt) package otherwise.  (Or clone the files from github.com 1.1.1 stable branch).
--with-ssl=/usr/include/openssl
EDIT:  
ls /usr/include/openssl
aes.h        buffer.h     cterr.h   engineerr.h  md5.h          pem.h        rsa.h        symhacks.h
asn1err.h    camellia.h   ct.h      engine.h     mdc2.h         pkcs12err.h  safestack.h  tls1.h
asn1.h       cast.h       des.h     e_os2.h      modes.h        pkcs12.h     seed.h       tserr.h
asn1_mac.h   cmac.h       dherr.h   err.h        objectserr.h   pkcs7err.h   sha.h        ts.h
asn1t.h      cmserr.h     dh.h      evperr.h     objects.h      pkcs7.h      srp.h        txt_db.h
asyncerr.h   cms.h        dsaerr.h  evp.h        obj_mac.h      rand_drbg.h  srtp.h       uierr.h
async.h      comperr.h    dsa.h     hmac.h       ocsperr.h      randerr.h    ssl2.h       ui.h
bioerr.h     comp.h       dtls1.h   idea.h       ocsp.h         rand.h       ssl3.h       whrlpool.h
bio.h        conf_api.h   ebcdic.h  kdferr.h     opensslconf.h  rc2.h        sslerr.h     x509err.h
blowfish.h   conferr.h    ecdh.h    kdf.h        opensslv.h     rc4.h        ssl.h        x509.h
bnerr.h      conf.h       ecdsa.h   lhash.h      ossl_typ.h     rc5.h        stack.h      x509v3err.h
bn.h         cryptoerr.h  ecerr.h   md2.h        pem2.h         ripemd.h     storeerr.h   x509v3.h
buffererr.h  crypto.h     ec.h      md4.h        pemerr.h       rsaerr.h     store.h      x509_vfy.h
EDIT2:   
Make sure it's openssl v1.0.2. Compiling curl doesn't seem to work with openssl v1.1.1a
     
    
./configure --with-ssl=/path/to/some/sslit is not working. That leaves me wondering if I am giving the right SSL path. Which path should I use? What should be the content of the directory(of which the path is).