tools: build libtool after autoconf, not before (fixes #18659)