Fix issue 112 - make legacy tm optional (autotools)