Magic Fang, Greater
Target: One living creature
This spell functions like magic fang, except that the enhancement bonus on attack and damage rolls is +1 per four caster levels (maximum +5).
Magic fang gives one natural weapon of the subject a +1 enhancement bonus on attack and damage rolls. The spell can affect a slam attack, fist, bite, or other natural weapon. (The spell does not change an unarmed strike’s damage from nonlethal damage to lethal damage.)
If you have a claw attack, and have Greater Magic Fang cast on you, giving your claw attack a +1 enhancement bonus to attack and damage per four caster levels, and then you lose that claw attack, you are still an eligible target ('One living creature'). If you later gain that claw attack (or, technically, any claw attack - as long as it's the same type of attack, and you're only providing GMF's bonus to one attack of that type ('the attack'), NONE of the wording on natural attacks ever differentiates one natural attack of the same 'type' from another), according to the text of Greater Magic Fang, it would give your claw attack a +X to attack and damage.
Nothing about the spell's text changes from you gaining or losing a claw attack. It provides one natural attack of one specific type (claw, bite, wing buffet), that you have at the time of casting, with a bonus. If you gain, lose, transmogrify, grow, shrink, dip it in poison, none of that changes the wording of Greater Magic Fang in any way. It provides that bonus to the attack. If the attack doesn't exist, it provides a bonus to nothing, but as long as the attack does exist it provides it with a bonus.
It's worth noting also that you can't cast a spell on something which is not part of the 'Target' entry of a spell. However, nothing stops you polymorphing a lawn chair into a zombie and then casting undead torch on it - the spell can only be cast on an undead target but, by RAW, does not stop functioning when the target changes. This gets houseruled at most tables without realizing it, but it's worth noting that 'spells not working anymore' thing is, itself, a houserule rather than something that's actually existent in the game rules.
On a RAI note
If a permanencied magic fang goes away when the wielder changes from his werewolf shape to his human shape, that negates the entire point of casting permanency in the first place. There's no indication that the authors felt that lycanthropes were too powerful and giving Dire Lions permanent magic fangs was okay but giving to werewolves was broken, or whatever.
Even if a sorcerer or wizard regularly used polymorph to take the form of a troll to fight in melee, and wished to use Permanency and Greater Magic Fang to give his troll claws and bite an enhancement bonus when he was in that form, the designers wouldn't bat an eye. For a start, it's nowhere near optimal sorcerer/wizard play, and for a second, it's the entire point of GMF in the first place: making natural weapons stronger in higher level play.