Compile with static libraries if possible