Build.sh improvements

- Use bash shell instead of sh. It's more flexible, modern and widely supported.
- Make flags should be declared in array
- Navigate to proper folder in case when build.sh was executed not from it's dir
- Use bash built-in [[ instead of old [. It's faster and safer.
- Add set -e variable, which could stop the script from executing after error, i.e. if compilation won't succeed (I turned off this one by default, you should decide if you're fine with that)
- Other misc cosmetic fixes

Please test if it doesn't cause issues to anyone before merging. I tested on my own Linux box and it worked properly.

Thank you for your work on PCSX2.