Justification was that target-dependent code means an implementation that is specific to a target and more target you cover means you can run software on more targets. ... As you can run the software on more targets, it makes the software more portable.
There's a very important difference between programs that can be made to run correctly on multiple targets and programs written with portable code.
Absent a standard, the way you make code run correctly on multiple targets is to write one implementation per target or group of targets that behave the same way. This sort of development was at its worst in code developed to run on Unix systems during the 1980s and early 1990s as competing vendors tried to capture as much of the market as possible and become "the" standard. It was not unusual for a program to make extensive use of conditional compilation or execution to make it work on the raft of vendor-specific flavors of System V and BSD. The implementations may be conveniently bound together into a single file and selected based on outside factors, but that doesn't change the fact that there are multiple implementations. Programs like this are not, by definition, portable because what runs on each target is different (i.e., it's target-specific code). They are, as gnasher729 points out in his answer, ported.
Portability comes from the adoption of standards that offer a well-defined API for programs to use that handles a target's idiosyncrasies behind the scenes. For example, I can be confident that this bit of C will compile and run as expected on Windows, Linux, Solaris or OS X:
int file = open("somefile", O_RDONLY);
lseek(file, 12345, SEEK_SET);
read(file, buffer, 1024);
/* Do something with buffer */
This is portable code because all of the targets listed above have ISO C compilers and libraries that conform to POSIX, where the P stands for portable.
The litmus test for portability is not having to make changes for it to run on a new target. What your prof is saying boils down to "a program can be run on any target where you can beat the source code into submission." In my book, that's the polar opposite of portability and makes him dead wrong.