rebar: check for system headers more thoroughly

Instead of hardcoding the gcc include paths, we now retrieve them by
calling a shell script in rebar.config.script.