More static build fixes

Try to generate somewhat sensible .la files. Note that this is still not enough to get a semi-static Xvnc and friends.

Also fix some dependency issues for mingw.