The mergesort algorithm described in the popular post by @templatetypedef does not work in O(n lg n). Because a linked list is not random access, step 2.1 Split the list into two lists of roughly equal size actually means an overall algorithm of O(n^2 log n) to sort the list. Just think about it a bit.
Here is a link that uses mergesort to sort a linked list by first reading the elements into an array -- http://www.geekviewpoint.com/java/singly_linked_list/sort.