Fix content branch makefile

This cherry picks and merges necessary stuff from master so we can successfully run a make command in the content branch.

I was able to successfully run the make and load gaia in the browser with these changes. (A full master catch-up would be better, but that seems more complicated).