Now I don't know why it worked with the internal oscillator, but the lcd.c file was missing the #define F_CPU part. I thought it would be enough to have it in the main.c guess it wasn't
Your lcd code most likely calculates things like the enable time, and adds nop's accordingly to meet the timing requirements. If the F_CPU define was required in lcd.c, you would get a compiler error if it was not provided, unless it used a default value if none provided (if not defined, define as a default value). The other possibility is your project has F_CPU set somewhere and is simply being passed to each c file as a compiler -D option, and it may still be using your old value, which you are now overriding with a specific define (correct value). You may want to check if F_CPU is set somewhere in your project (makefile, ide settings, or whatever)- and use that instead (then only need to set in one place).
Also keep in mind, each c file is compiled as a separate 'unit'- each c file needs to have all the info it needs to compile (from headers, etc.), and will not use any info from other c files. So, lcd.c does not know anything about main.c, or any other c file you have- if it needs a define, you have to provide it in the lcd.c file, or include a header which has it (or provided with a compiler -D option), if it needs access to a function in another c file, it needs to know about it (an include header, or just specifying the function prototype/declaration). Whatever it takes for each c file to have all the info it needs to compile.