configure: add datadir variable and write to config.{h,mak}