Makefiles: handle DESTDIR

Closes #1369