Improve makefile for that IMPORTDIR is specified
Improve for handling stack overflow