autotools: use builddir for log dir

top_srcdir is read-only iwhen running 'make distcheck' so creating
the directory in it can lead to error.