I've solved it by myself.
Applied patch was using
LOCAL_MODULE_TAGS := tests
while to properly compile user build we need to change it to
LOCAL_MODULE_TAGS := optional
and add module name memtool to PRODUCT_PACKAGES in vendor board makefille which for our is /device/variscite/var_som_mx6q/var_som_mx6q.mk. So it's like this:
PRODUCT_PACKAGES += \
memtool