Added more env variables to the makefile and fixed bugs in db.js