Fix dependency checking with bmake

gmake always includes files relative to the current directory, while
bmake includes them relative to the current Makefile - and current
Makefile means the current include. However, bmake has a variable
.CURDIR that always points to the current directory, but is missing in
gmake. Thus, .CURDIR is just set to "." if it's not set and always in
the include, thus making it work with both, bmake and gmake.