fix static build script

add missing pthread & dl
run automake/autoconf