__USE_LARGEFILE64 and __USE_XOPEN_EXTENDED are *not* user macros. You want to use _FILE_OFFSET_BITS and _XOPEN_EXTENDED respectively. However, these must be defined before any includes are done and (at least the former) should be done across all files. I suggest that they be added to the CFLAGS (e.g. in the automake files).
Better to add it to config.hin.