How to compile GNU Emacs 25.1 on 16.10

This is reported as http://debbugs.gnu.org/24682. A workaround is to use ./configure CFLAGS=-no-pie .