As suggested by some of the members in this forum, I have started making templates completely in header files. But now when I am making rules for header files, it is more clumsy.
Well, I am not sure about it either. But what I am sure about is, that you should specify all the dependencies for each file in your make file for proper compilation.