fixes in build scripts

Fixed warnings and errors on ./autogen.sh run.