Adjust libtool and linker flags

Since we use libtool, -static-libgcc and -static-libstdc++ are
stripped by libtool and not used. We just use -all-static libtool flag
for this purpose.

To create windows dll, it turns out that we need -no-undefined flag.