Fixed major problems for qt5 building. Probably broke qt4. Does not link
for qt5 yet.