Switch to compiling dependencies as static libraries [NEEDS TESTING]

Improves building on Windows and eases the transition to Qt5.

Currently this has only been tested on Linux. I don't have a Mac, but hopefully someone can test it there. I'll try to run it on Windows as soon as I can get a chance.