As a workaround I just added -DOPENSSL_NO_DH to the makefile.