Makefile: fix dependencies calculation