When a capillary is inserted into a liquid, the liquid will rapidly flow into it. This phenomenon, well studied and understood on the macroscale, is investigated by Molecular Dynamics simulations for coarse-grained models of nanotubes. Both a simple Lennard-Jones fluid and a model for a polymer melt are considered. In both cases after a transient period (of a few nanoseconds) the meniscus rises according to a time-law. For the polymer melt, however, we find that the capillary flow exhibits a slip length δ, comparable in size with the nanotube radius R. We show that a consistent description of the imbibition process in nanotubes is only possible upon modification of the Lucas-Washburn law which takes explicitly into account the slip length δ.