A free boundary problem and an extension of Muskat's model