rebar compilation related improvements

After this is in Fedora, most if not all packages built with rebar should be converted to use %rebar_compile and rebuilt in order to get them to build with Fedora's optflags. I can help with that.