update make-pkg with some better error reporting and debug flag