To get Nettle to compile you have to rename __argc and __argv in tools/getopt.h to e.g. _argc and _argv. You'll also have to fix all the x86/*asm files so that global identifiers have one more underscore. E.g. in sha1-compress.asm, add one line .globl __nettle_sha1_compress and one line __nettle_sha1_compress: next to the existing similar lines.
Easiest is to compile without nettle of course.