I checked again and it still happened.  So then I checked on a different
Ubuntu 18.04 system and there was no problem.  So then I compared the
config.log files from the two systems to see how they differed.  That
revealed the problem.

On the system where the link failed I had previously built and installed
Tcl 8.7. In fact I had done that before I upgraded from 16.04 to 18.04.
The configure script was reading Look at this:

$ grep ieee
TCL_LIBS='-ldl -lz  -lpthread -lieee -lm'

So I guess the question is: Why is the configure script using a tclConfig.sh
which was installed by a different version of Tk (and a different version of
the operating system)?

Even on the system where the build succeeds the behavior is weird. The
configure script is reading Why is it assuming that
I want to use the same compiler and linker flags that the package maintainer
happened to use?  And if I had installed the Tk 8.7 package and then tried to
build Tk 8.6 it would have used the 8.7 linker flags, so it would link against
the ieee library even though 8.6 doesn't need that library.

This does not seem very robust to me.