That resinous gook is creosote.
Clean the chimney well once a year and it shouldn't be a problem.
But if you let the creosote build up for a couple of years, you'd better stock up on hot chocolate, hot dogs, and marshmallows. Have one hot fire in the fireplace/stove and . . . *poof* . . . you'll be having the fire department over.
Firemen like hot chocolate, hot dogs, and marshmallows roasted over the open fire (even if it's your chimney and roof).