This was the command line I had to use to get it to install. It was trying to link against a more modern version of OpenSSL otherwise that did not work.
CFLAGS=-Wno-implicit-function-declaration CPPFLAGS="-I$(brew --prefix openssl@1.1)/include -I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl@1.1)/lib -Wno-implicit-function-declaration" pyenv install 3.6.15