Fixed bugs in make scripts