fix the compile issue for new gcc versions

Fixed:
error: optarg was not declared in this scope
error: getopt was not declared in this scope