Added some simple platform detection

I have implemented some simple platform detection so you don't have to set the platform option on ubuntu.

It should be pretty robust in that if can't find or execute the command that finds the platform it simply defaults to the original mac platform.