Fix Linux code and create build file for linux