Added paths for xcode

/usr/local/include and /usr/local/lib need to be explicitly added for
xcode build to work
Changed arguments parsing

Script file is set to be first argument that does not start with a ‘-‘,
not the last. This helps xcode since it adds extra arguments when
running the app