Millwall have signed Lee Martin on a free transfer following his release from Championship rivals Ipswich.