Fix builds against static languages

And add a linux target to build script