Updated build script

Project now correctly builds pkg and dmg files when compiling.