fixed build script so it works when Internet is down

Change-Id: Id44e33573cccaf8929f0720ad4e2cf460d1efaee