It seems that ttmkfdir erroneously pulls in the getopt.h installed in /usr/local/include instead of the one in /usr/include. The getopt.h in /usr/local/include is installed by libgnugetopt.