Added support for building with OBJDIR
Stricter checks for proper usage