OpenWRT 15.05 Chaos Calmer on Mac OS X El Capitan 10.11

When I try to build new OpenWRT release 15.05 Chaos Calmer on OSX 10.11 mkimage build fails with following error:
Undefined symbols for architecture x86_64:
“_ERR_remove_thread_state”, referenced from:
_rsa_sign in rsa-sign.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[5]: *** [tools/dumpimage] Error 1
make[4]: *** [tools-only] Error 2
make[3]: *** [/Volumes/OpenWRT/openwrt/build_dir/host/u-boot-2014.10/.built] Error 2
make[3]: Leaving directory `/Volumes/OpenWRT/openwrt/tools/mkimage’
make[2]: *** [tools/mkimage/compile] Error 2
make[2]: Leaving directory `/Volumes/OpenWRT/openwrt’
make[1]: *** [/Volumes/OpenWRT/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2/stamp/.tools_install_yynyynynynyyyyyyyyyyyyyyyyyyynyyyyynnyyynyyynnnyy] Error 2
make[1]: Leaving directory `/Volumes/OpenWRT/openwrt’
make: *** [world] Error 2

So, I replaced openssl with the one comes with homebrew build. Replaced Host/Compile section in tools/mkimage/Makefile, solves the issue.

define Host/Compile

$(MAKE) -C $(HOST_BUILD_DIR) defconfig

HOSTCFLAGS=”$(HOST_CFLAGS) -I/usr/local/Cellar/openssl/1.0.2d_1/include” \
HOSTLDFLAGS=”$(HOST_STATIC_LINKING) $(HOST_LDFLAGS) -L/usr/local/Cellar/openssl/1.0.2d_1/lib” \
$(MAKE) -C $(HOST_BUILD_DIR) tools-only
endef