Support building dependencies with erlang.mk in a different directory

If a dependency has no makefile, it is built by including the project's own erlang.mk .This is done by `$(CURDIR)/erlang.mk`, which assumes that erlang.mk is in the same directory as the project's Makefile. This doesn't work if a project has make targets in different directories that share a single erlang.mk in the file tree, e.g. project/apps/app1/Makefile includes ../../erlang.mk.
This can be fixed by using MAKEFILE_LIST.