fixed build.py when using gcc only. Closes #1044