I don't currently have a Linux pkgsrc build environment set up, so I can't easily test this. However, I *think* that you can solve the problem by moving the line .include "../../security/openssl/buildlink3.mk" from Makefile (in mail/claws-mail) to Makefile.common.