Don't use getopt() if it doesn't exists

Now just don't use getopt() on platforms without it. Later maybe add
platform-independenr getopt()