I've built my own stunnel extension. I'll post my build commands below if it helps:
CFLAGS="-O2 -pipe" \
CXXFLAGS="-O2 -pipe -fno-exceptions -fno-rtti" \
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig \
./configure --prefix=/usr/local --sysconfdir=/usr/local/etc/stunnel --with-ssl=/usr/local --disable-systemd
make
The rest is just standard extension building stuff.