Work on make script and fix bugs