make static linking against libmysqld.a actually work,

and don't install libmysqld.a when linking statically
(bug #482 and #483)