make build script slightly more robust
fix incompatibility with gcc 4.9 (for the record: gcc was right)