We provide complete and optimized binaries for all platforms to which NAMD has been ported. It should not be necessary for you to compile NAMD unless you wish to add or modify features.
Directions for compiling NAMD are contained in the release notes, which are available from the NAMD web site http://www.ks.uiuc.edu/Research/namd/ and are included in all distributions.