Madwifi Driver Installation Error : "Cannot detect kernel version"

Just install module-assistant and choose the madwifi from the module assistant list, this will allow you to download, compile and install the modules.