TS-2624: Backport Makefile fix