With upstream https://github.com/GreycLab/gmic/pull/412 backported, we can just pass PREFIX and LIB to Makefile and it installs everything in the correct location.