Makefile: fix misdetection of relative pathnames