Make build work internally and externally

@rev gtorres@
Merge branch 'dchasman/master-pending-opensourcefixes'