-려면 is 'if you intend to', and repeating the same verb after it gives two readings. 하려면 할 수 있다 is 'it could be done if we wanted to' — the ability was there all along. 먹고살려면 해야지 is the other one: if you want to eat, you have to. And 하려면 하고 말려면 말지 is a shrug — do it or don't, up to you.