Refine configure checks and add KF5