fixed makefile and made error functions independent