libgsocket.a is build in a way that is does not include symbols from OpenSSL, and test binaries are only linked to that (and libutil), but not to OpenSSL libs. In result, linking fails.
It does work, however, if --enable-static=no is dropped. But this is still a bug: if static should not be disabled, then the option should not exist or not have an effect; if it is a valid option, then build with tests should work.