use compiler variables instead of commands

I was trying this out to help my build problems, and it just seemed like a good idea anyway.