Setup makefile and fixed stack corruption in loader bug