I don't think it can be racist if the joke is told within your group but it is questionable if it isn't - it's pretty hard to accuse a black person of being racist if they resort to telling jokes about their own and to laugh off the stereotype by embracing it - seem to remember Spurs fans wanting to own the term "Yids" in order to reduce the effect of others calling them unpleasant names. You can't insult some one so well if they refuse to rise to the insult - like LGBT now tend to own the rather unpleasant term "Queer" which has, largely, disappeared from common use.
Of course this is just my POV and others might be offended if someone within their (ethnic) group took offence.