I don't know what strange aftertaste you are referring to........but here might be some causes--
Old flour
Old butter
Old cornstarch
The salt, sugar, and vanilla usually won't have an impact, unless the dry ingredients have been stored in an area where they can absorb other strong smells or odors.
If you keep your flour out, or just in the paper bag it comes in, flour can absorb odors and smells just like baking soda, which can cause weird aftertastes in food.
Old butter can cause an aftertaste that just makes something taste out of date, old, bitter, or like cardboard.
Old flour can make something taste like dirt, cardboard, or just old and moldy.
Same goes for old cornstarch.
If you do not store your dry ingredients in plastic, air tight containers, then you should. Or at least giant zip lock baggies.
There isn't much you can do about old butter though. It will get old, no matter how you wrap it up or contain it.
If none of your ingredients were old, or had absorbed any other odors or smells, then more than likely it is the type of flour and vanilla you are using.
For some reason, I have found, some brands of flour and flavorings just do not work together. Artificial flavorings don't seem to have such a bad side effect on taste as the natural ones do. You might try different brands of flour and/or flavorings to see what works.
There are some butter cookie recipes out there, you just can't get away from the funky "greasy, cardboardy" after taste though....it's just the way the ingredients work together.
You might try using a couple of tablespoons of ground pecans in your batter next time....see if that helps the taste any.