build: do not link with libssl if not needed