build: use local getopt for anything system where it's missing
Do not force include the compat folder as it may contain headers that do exist for the compiler. Include the compat headers individually when they are needed and use an explicit path to compat/
Edited by Steve Lhomme