Melt butter in a medium saucepan over medium-low heat, skimming foam that rises to the surface. When foam subsides, remove pan from heat and carefully pour clarified butter into a large mixing bowl, leaving milky solids behind. Refrigerate clarified butter until almost solid, about 40 minutes
Bring butter to room temperature, and in a bowl beat the clarified butter with an electric mixer on medium-high speed until white and fluffy, about 10 minutes. Gradually add sugar while beating constantly, until mixture is light and fluffy, about 5 minutes.
Sift together the mastic and baking soda with one cup of the flour and add to the butter mixture and mix well. Add flour as needed until the dough won't absorb any more. Work it well with your hands and form into a ball
Take a piece of dough the size of a walnut, roll between the hands and shape into a mildly curved "S", about 4 inches long.
Lay on an ungreased baking sheet well apart form each other. Press an almond or a pine nut in the middle of each.
Bake in preheated oven 300 degrees F, until the bottoms turn lightly golden for about 15 minutes.
Cool and store in an airtight container
Makes about 20 cookies