Ham, courgette and macaroni bake