add support for bsd getopt
Merge pull request #3 from slaanesh/master

BSD getopt does not work