correct script for some shellcheck.net warnings
safer handling of globbed file names
store all compilation flags in arrays

this is safer as well and allow for spaces in flags
same for windows